#ifndef IGSLIB_MARQUEE_H
#define IGSLIB_MARQUEE_H

#include <set>
#include <igslib_imarquee.h>

namespace igslib 
{
    class CMarquee:public IMarquee
    {
        protected:
            float gpno;
			float bstime;
			int duty;
			bool SR;
			IMarquee::State st;
			ISpi* spi;
			IGPIO* gplamp;
			IGPIO* gpclk;
			IGPIO* gpdata;
			IGPIO* gplatch;
        public:
            CMarquee()
            {
                gpno = 0;
                spi = nullptr;
				gplamp = nullptr;
				gpclk = nullptr;
				gpdata = nullptr;
				gplatch = nullptr;
				st=IMarquee::State::idle;
                SR = false;
            }
            virtual State GetState(){return State::idle;}
            virtual void RunGroup(int value,bool value1){gpno=value;SR=value1;}
            virtual void ImportGroup(int,int,unsigned char*){}
            virtual void ImportPattern(int,int,const LEDColor*){}
            virtual void SetPatternDuration(const float& value){bstime=value;} 
            virtual std::string GetName() { return std::string("CMarquee"); }
            virtual void Reset(){}
            virtual void SetSPI(ISpi* value) { spi = value; }
            virtual void SetDutyCycle(int value){duty=value;}
            virtual void SetGPIO(IGPIO* value,IGPIO* value1,IGPIO* value2){gpclk=value;gpdata=value1;gplatch=value2;}	
            virtual void SetGPIO(IGPIO* value){gplamp=value;} 
    };

    class CMarqueeManager:public IMarqueeManager
    {
        std::set<IMarquee*> marquees;
        static IMarqueeManager* instance;
		char count;
        public:
            static IMarqueeManager* GetInstance();
            ~CMarqueeManager();
            virtual void DeleteMarquee(IMarquee* value);		
			virtual IMarquee* New_ProjMCU(const std::string& name);
    };
};

#endif
